package com.kly.sc.api.application.controller.user.request;

import com.fqgj.common.api.ParamsObject;
import com.kly.sc.api.infras.enums.RestCodeEnum;
import com.kly.sc.api.infras.exception.ApplicationException;
import lombok.Data;

import java.util.Objects;

/**
 * 用户照片
 * @author linqu
 */
@Data
public class RemoveImagesRequest extends ParamsObject {


    /**
     * 照片内码
     */
    private String imageCode;
    /**
     * 相册页
     */
    private String albumCode;
    /**
     * 相册类型
     */
    private Integer type;

    @Override
    public void validate() {

        if (Objects.isNull(this.type)) {
            throw new ApplicationException(RestCodeEnum.SYSTEM_PARAMETER_ERROR);
        }
        if (Objects.isNull(this.imageCode)) {
            throw new ApplicationException("The image should not be empty");
        }
        if (Objects.isNull(this.albumCode)) {
            throw new ApplicationException("The album should not be empty");
        }

    }
}
